package bankofficegrepper

import grails.spring.BeanBuilder

/**
 * Created by IntelliJ IDEA.
 * User: JLeo
 * Date: 2009-10-7
 * Time: 11:08:37
 * To change this template use File | Settings | File Templates.
 */

def gormEnvBeanBuilber = new BeanBuilder()
gormEnvBeanBuilber.beans {
  xmlns gorm: "http://grails.org/schema/gorm"

  dataSource(org.apache.commons.dbcp.BasicDataSource) {
    url = "jdbc:mysql://localhost:3306/bankoffice"
    password = "root"
    username = "root"
    driverClassName = "com.mysql.jdbc.Driver"
  }

  hibernateProperties(String, """
  hibernate.show_sql=true
  hibernate.hbm2ddl.auto=update
  """)

  gorm {
    sessionFactory(
            "base-package": "bankofficegrepper",
            "data-source-ref": "dataSource") {
      property(name: "hibernateProperties", ref: "hibernateProperties")
    }
  }
}
gormEnvBeanBuilber.createApplicationContext()

BankInfo bi =new BankInfo([city:'上海'])
bi.add()
println 'aaa'